<a-form
  ref="formRef"
  :model="formData"
  :rules="formRules"
  layout="vertical"
>
  <a-row :gutter="16">
    <%_ for(var i = 0; i < formConfig.fields.length; i++){ _%>
      <a-col :span="<%= formConfig.fields[i].span %>">
      <%_ if(formConfig.fields[i].type === 'text'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-input v-model:value="formData.<%= formConfig.fields[i].name %>" placeholder="请输入<%= formConfig.fields[i].label %>" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'photo'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
          <t-upload v-model:value="formData.<%= formConfig.fields[i].name %>" file-type="image" :max-count="10" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'file'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
          <t-upload v-model:value="formData.<%= formConfig.fields[i].name %>" :max-count="10" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'editor'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
          <xn-editor v-model="formData.<%= formConfig.fields[i].name %>" placeholder="请输入<%= formConfig.fields[i].label %>" :imageSizeLimit="1" :mediaSizeLimit="500" :height="500" :length="999999" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'textarea'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-textarea v-model:value="formData.<%= formConfig.fields[i].name %>" placeholder="请输入<%= formConfig.fields[i].label %>" :auto-size="{ minRows: 5, maxRows: 8 }" show-count :maxlength="200"/>
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'number'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-input-number v-model:value="formData.<%= formConfig.fields[i].name %>" placeholder="请输入<%= formConfig.fields[i].label %>" :min="1" :max="100" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'select'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <DictSelector v-model="formData.<%= formConfig.fields[i].name %>" dict="user_type" placeholder="请选择<%= formConfig.fields[i].label %>" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'radio'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <DictSelector v-model="formData.<%= formConfig.fields[i].name %>" dict="user_type" type="radio" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'checkbox'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <DictSelector v-model="formData.<%= formConfig.fields[i].name %>" dict="user_type" type="checkbox" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'cascader'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-cascader v-model:value="formData.<%= formConfig.fields[i].name %>" :options="[]" placeholder="请选择<%= formConfig.fields[i].label %>" :fieldNames="{ label: 'name', value: 'id' }" />
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'any'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        需要封装一波组件
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'date'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-date-picker v-model:value="formData.<%= formConfig.fields[i].name %>" value-format="YYYY-MM-DD" placeholder="请选择<%= formConfig.fields[i].label %>"/>
      </a-form-item>
      <%_ } else if(formConfig.fields[i].type === 'dateRange'){ _%>
      <a-form-item name="<%= formConfig.fields[i].name %>" label="<%= formConfig.fields[i].label %>">
        <a-range-picker v-model:value="formData.<%= formConfig.fields[i].name %>" value-format="YYYY-MM-DD" :placeholder="['开始时间','结束时间']"/>
      </a-form-item>
      <%_ } _%>
    </a-col>
    <%_ } _%>
  </a-row>
</a-form>
